home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-21 | 936 b | 38 lines | [TEXT/ttxt] |
- //-------------------------------------------------------------------//
-
- // Syntax: tmp_file ( )
-
- // Description:
-
- // The tmp_file function generates a string, which can be used as a
- // temporary file name. The tmp_file function generates the file name
- // with the help of the system's date program. If your particular
- // platform does not support the date usage as delivered, then modify
- // the argument to system() to get the correct effect.
-
- //-------------------------------------------------------------------//
-
- static (K); // to help insure unique name during a session
- K = 1;
-
- tmp_file = function ( )
- {
- local (ans, k, pfile, sans);
-
- //
- // Generate a date string that looks like hhmmss. That is
- // numerical hour, minutes, seconds.
- //
-
- pfile = "|date +%H%M%S";
- ans = getline (pfile);
- close (pfile);
-
- sprintf (sans, "%i", ans.[1]);
- sprintf (k, "%i", K);
- K++;
-
- return "rlab-" + sans + "." + k;
- };
-
-